home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 2 / CD ACTUAL VOL 2.iso / kernels / makedisk < prev    next >
Encoding:
Text File  |  1995-09-10  |  2.0 KB  |  74 lines

  1. #!/bin/sh
  2. #define Q+D
  3. #
  4. # This makes a bootkernel disk in /dev/fd0 from a kernel image.
  5. #
  6. # Run this in a directory containing the kernels you're gonna use, and a
  7. # subdirectory with a master image of the bootkernel disk.
  8. #
  9. # This is the command to use:
  10. #
  11. # makedisk kernel_image disk_size
  12. #          ^^           ^^^^^^^^^ This is 1440 or 1200
  13. #          ^^^^^ This is the name (and maybe path to) the kernel you're going
  14. #                to use, such as scsinet/scsinet.
  15. #
  16. #
  17. KERNEL=$1
  18. DISKSIZE=$2
  19. TARGET=/dev/fd0
  20. MASTER_DIR=master
  21. #
  22. if [ $DISKSIZE = 1200 ]; then
  23.  cp lilo.conf.1200 $MASTER_DIR/etc/lilo.conf
  24.  RAMSIZE=1200
  25. elif [ $DISKSIZE = 1440 ]; then
  26.  cp lilo.conf.1440 $MASTER_DIR/etc/lilo.conf
  27.  RAMSIZE=1440
  28. else
  29.  echo
  30.  echo "Usage: makedisk kernel_image disk_size"
  31.  echo
  32.  echo "Disk is made in /dev/fd0. Target disk must be formatted."
  33.  echo "Legal disk sizes are 1200 and 1440."
  34.  echo
  35.  exit
  36. fi
  37. if [ -r $1 ]; then
  38.  echo "Making a bootkernel disk from kernel image $1..."
  39. else
  40.  echo "Image $1 not readable."
  41.  exit
  42. fi
  43. cp $1 $MASTER_DIR/vmlinuz 
  44. echo "Rdeving -R $MASTER_DIR/vmlinuz 0"
  45. rdev -R $MASTER_DIR/vmlinuz 0
  46. echo "Rdeving -r $MASTER_DIR/vmlinuz $RAMSIZE"
  47. rdev -r $MASTER_DIR/vmlinuz $RAMSIZE
  48. echo "Rdeving -v $MASTER_DIR/vmlinuz -v"
  49. rdev -v $MASTER_DIR/vmlinuz -1
  50. # It's possible some people might want to use /dev/fd0h1200 or /dev/fd0H1440
  51. # on the line below...
  52. echo "Rdeving $MASTER_DIR/vmlinuz /dev/fd0"
  53. rdev $MASTER_DIR/vmlinuz /dev/fd0
  54. #echo "Formatting the target disk..."
  55. #fdformat /dev/fd0H1200
  56. echo "Blanking the target disk..."
  57. dd if=/dev/zero of=$TARGET 2> /dev/null
  58. echo "Making the MINIX/Linux filesystem..."
  59. # Let's use a 600K size, since that's good enough for the kernel + utilities
  60. # needed to boot... then we can reduce the size of the uncompressed disks.
  61. mkfs.minix -i 400 $TARGET 600
  62. echo "Mounting the disk on /mnt..."
  63. mount $TARGET /mnt
  64. cd $MASTER_DIR
  65. echo "Copying the files over..."
  66. cp -a * /mnt
  67. sync
  68. echo "Installing LILO..."
  69. lilo -r /mnt
  70. sync
  71. umount /mnt
  72. echo "Bootkernel disk created."
  73.